package config
{
	import Common.GameResManager;

	public class ItemConfig
	{
		public var object:Object = null;
		
		public function ItemConfig()
		{
			
		}
		
		
		public static var instance:ItemConfig = null;
		public static function Instance():ItemConfig
		{
			if ( instance == null )
			{
				instance = new ItemConfig();
			}
			
			return instance;
		}
		
		
		public function init():void
		{
			object = new Object();
			var obj:Object = GameResManager.instance.mainRes;
			var xml:XML = XML( new GameResManager.instance.mainRes.itemString() );
			
			for each ( var element:XML in xml.elements() )
			{
				var id:String = element.@id;
				
				object[ id ] = element;
			}
			
			xml = null;
		}
		
		
		public function getString( id:int ):Object
		{
			return object[ id ];
		}
		
	}
}